﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;

public partial class Information_Default : System.Web.UI.Page
{
    HelpMessageBO hbo = new HelpMessageBO();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if ((Request.QueryString["FromUserName"] != null || Session["FromUserName"] != null) && (Request.QueryString["ToUserName"] != null || Session["ToUserName"] != null))
            {
                string user = Request.QueryString["FromUserName"] == null ? Session["FromUserName"].ToString() : Request.QueryString["FromUserName"].ToString();
                string user2 = Request.QueryString["ToUserName"] == null ? Session["ToUserName"].ToString() : Request.QueryString["ToUserName"].ToString();
                Session["FromUserName"] = user;
                Session["ToUserName"] = user2;
            }
            if (Request.QueryString["id"]!=null)
            {
                HelpMessage h = hbo.GetModel(int.Parse(Request.QueryString["id"].ToString()));
                if (h != null)
                {
                    title.Text = h.Title;
                    lblText.Text = h.Content;
                }
            }
        }
    }
}